package controller;

import org.atmosphere.cpr.AtmosphereResource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import utils.AtmosphereUtils;

import java.io.IOException;

/**
 * Created by alex on 15-1-20.
 */
@Controller
public class ChatController {
    @RequestMapping("/websockets")
    @ResponseBody
    public void subscribe(AtmosphereResource resource) throws IOException {
        resource.getResponse().setContentType("text/html");
        AtmosphereUtils.suspend(resource);
    }
    
}
